package com.gitee.l0km.beanfilter.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.gitee.l0km.beanfilter.core.Activation;
import com.gitee.l0km.beanfilter.core.CodecPhase;
import com.gitee.l0km.beanfilter.core.CodecScope;
import com.gitee.l0km.beanfilter.core.StringCoverFilter;
import com.gitee.l0km.casban.ctor.annotations.CtorArg;
import com.gitee.l0km.common.spring.core.annotation.AliasFor;

/**
 * [序列化]基于{@link StringCoverFilter}的字符串覆盖值过滤器注解<br>
 * 可以用于密码字段保护，
 * 字段说明参见 {@link StringCoverFilter#StringCoverFilter(Class, boolean, String, char, int, Class[], String[], boolean)}
 * 和{@link FilterMeta}同名字段
 * @author guyadong
 *
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD })
@ValueFilter(filterClass = StringCoverFilter.class,phase = CodecPhase.SERIALIZATION)
@Repeatable(PasswordValueFilters.class)
public @interface PasswordValueFilter {
	@CtorArg(0)
	@AliasFor(annotation = FilterMeta.class,attribute = "beanClass")
	Class<?> beanClass() default Object.class;
	@CtorArg(1)
	boolean autoCase() default false;
	@CtorArg(2)
	String filterName();
	@CtorArg(3)
	char cover() default '*';
	@CtorArg(4)
	int outputLength() default 0;
	@CtorArg(5)
	Class<? extends Activation>[]  activeOn() default {};
	@CtorArg(6)
	String[]  activeOnClassNames() default {};
	@CtorArg(7)
	boolean  activeAnd() default true;
	/**
	 * @see FilterMeta#scope()
	 */
	@AliasFor(annotation = FilterMeta.class,attribute = "scope")
	CodecScope scope() default CodecScope.ALL;
}
